package com.nddwm;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/*
 *功能描述
 *@package com.nddwm
 *@description 正则表达式
 *@date 2021/11/30
 *@USER 刘观圣
 */
public class TestRegix {
    private static Pattern compile = Pattern.compile("[123]");
    private static Scanner scanner = new Scanner(System.in);

    /**
     * 功能描述
     *
     * @Description: 正则表达式练习
     * @Param: [args]
     * @return: void
     * @Date: 2021/11/30
     * @Author: 刘观圣
     */
    public static void main(String[] args) {
        while (true) {
            String str = scanner.nextLine();
            Matcher matcher = compile.matcher(str);
            boolean matches = matcher.matches();
            System.out.println(matches);
            //System.out.println(matcher);
            /*while (matcher.find()) {
                System.out.println("start() " + matcher.start());
                System.out.println("end() " + matcher.end());
                System.out.println();
            }*/
        }

    }

}
